package com.zh.note.huawei.twohundred.观看文艺汇演问题;

import java.util.Arrays;
import java.util.Scanner;

/**
 * https://dream.blog.csdn.net/article/details/130876965
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        //time[0]开始时间，time[1]结束时间
        int[][] times = new int[n][2];
        for (int i = 0; i < n; i++) {
            times[i][0] = sc.nextInt();
            times[i][1] = times[i][0] + sc.nextInt();
        }
        Arrays.sort(times, (a, b) -> {
            return a[1] - b[1];
        });
        int t = times[0][1];
        int res = 1;
        for (int i = 1; i < times.length; i++) {
            int l = times[i][0];
            int r = times[i][1];
            if (l - t >= 15) {
                res++;
                t = r;
            }
        }
        System.out.println(res);
    }
}
